package com.hsogoo.ultraman.spring.refreshable;

import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;

import java.util.Collection;

/**
 * 可刷新配置注册中心
 * @Author huangsaigang
 * Created @2018/9/23.
 */
public class RefreshableConfigRegistry {

    private final Multimap<String, RefreshableConfig> registry = LinkedListMultimap.create();

    public void register(String key, RefreshableConfig refreshableConfig) {
        registry.put(key, refreshableConfig);
    }

    public Collection<RefreshableConfig> get(String key) {
        return registry.get(key);
    }
}
